home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / Interfaces / QD3D.h next >
Encoding:
C/C++ Source or Header  |  1995-11-14  |  27.0 KB  |  848 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3D.h                                                     **                        
  4.  **                                                                              **
  5.  **                                                                              **
  6.  **     Purpose:     System include file.                                     **            
  7.  **                                                                              **
  8.  **                                                                              **
  9.  **                                                                              **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                              **
  12.  **                                                                              **
  13.  *****************************************************************************/
  14. #ifndef QD3D_h
  15. #define QD3D_h
  16.  
  17. #include <stdio.h>
  18.  
  19. /******************************************************************************
  20.  **                                                                             **
  21.  **                                Porting Control                                 **
  22.  **                                                                             **
  23.  *****************************************************************************/
  24.  
  25. #ifndef OS_MACINTOSH
  26.  
  27.     #define OS_MACINTOSH                1
  28.     #define WINDOW_SYSTEM_MACINTOSH        1
  29.  
  30.     #if defined(THINK_C) || defined(__SC__) || defined(__MWERKS__)
  31.          #define PRAGMA_ONCE                1
  32.     #else
  33.          #define PRAGMA_ONCE                0
  34.     #endif  /*  defined(THINK_C) || defined(THINK_CPLUS) || defined(__MWERKS__) || defined(SYMANTEC_CPLUS)  */
  35.  
  36.     /*
  37.      * Set required compiler options (if possible):
  38.      *   1. enums must always be ints in QD3D and in applications;
  39.      *      this consistency is required to prevent misinterpretation
  40.      *      of an app's enum values by an API; it is also required for
  41.      *      compliance with ANSI
  42.      *   2. alignment of char and short arrays in structures is not on
  43.      *      long boundaries; (could be other way, but must be consistent
  44.      *      in QD3D and in applications)
  45.      *   3. alignment of longs, floats, and pointers in structures
  46.      *      is on long boundaries for PowerPC
  47.      */
  48.     #if defined(THINK_C) || defined(__SC__)
  49.         #pragma options(!pack_enums, !align_arrays)
  50.         #pragma SC options align=power
  51.     #elif defined(__MWERKS__)
  52.         #pragma enumsalwaysint on
  53.         #pragma align_array_members off
  54.         #pragma options align=native
  55.     #elif defined(__PPCC__)
  56.         #pragma options align=power
  57.     #endif
  58.     
  59.     enum {
  60.         gestaltQD3D                = 'qd3d',
  61.         gestaltQD3DVersion        = 'q3v ',
  62.         gestaltQD3DNotPresent    = 0,
  63.         gestaltQD3DAvailable    = 1
  64.     };
  65.     
  66. #endif  /*  OS_MACINTOSH  */
  67.  
  68. #if defined(_WIN32) && _WIN32
  69.     #define WINDOW_SYSTEM_WINDOWS        1
  70. #endif  /*  defined(_WIN32) && _WIN32  */
  71.  
  72. #if defined(PRAGMA_ONCE) && PRAGMA_ONCE
  73.     #pragma once
  74. #endif  /*  PRAGMA_ONCE  */
  75.  
  76. /*
  77.  *  NOTE:  To compile on a Unix workstation (assumes X11 window system):
  78.  *                1. Add to compiler command line: "-DOS_MACINTOSH=0"
  79.  *                2. Add "-DOS_UNIX=1"
  80.  *                3. Add "-DWINDOW_SYSTEM_X11=1"
  81.  */
  82.     
  83. /*
  84.  *  NOTE:  To compile on a DOS/WINDOWS machine:
  85.  *                1. Add to compiler command line: "-DOS_MACINTOSH=0"
  86.  *                2. Add "-DOS_WINDOWS=1"
  87.  *                3. Add "-DWINDOW_SYSTEM_WINDOWS=1"
  88.  */
  89.  
  90.  
  91. /******************************************************************************
  92.  **                                                                             **
  93.  **                                Export Control                                 **
  94.  **                                                                             **
  95.  *****************************************************************************/
  96.  
  97. #if defined(_MSC_VER)    /* Microsoft Visual C */
  98.     #define QD3D_EXPORT        __declspec( dllexport )
  99. #else
  100.     #define QD3D_EXPORT
  101. #endif  /*  _MSC_VER  */
  102.  
  103.  
  104. /******************************************************************************
  105.  **                                                                             **
  106.  **                                NULL definition                                 **
  107.  **                                                                             **
  108.  *****************************************************************************/
  109.  
  110. #ifndef NULL
  111. #error /*    NULL is undefined?    */
  112. #endif /* NULL */
  113.  
  114.  
  115. /******************************************************************************
  116.  **                                                                             **
  117.  **                                    Objects                                     **
  118.  **                                                                             **
  119.  *****************************************************************************/
  120. /*
  121.  * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  122.  * deletion, duplication, and i/o methods.
  123.  */
  124. typedef long                    TQ3ObjectType;
  125.  
  126. typedef struct TQ3ObjectPrivate    *TQ3Object;
  127.  
  128. /*
  129.  * There are four subclasses of OBJECT:
  130.  *    an ELEMENT, which is data that is placed in a SET
  131.  *    a SHAREDOBJECT, which is reference-counted data that is shared
  132.  *    VIEWs, which maintain state information for an image
  133.  *    a PICK, which used to query a VIEW
  134.  */
  135. typedef TQ3Object                TQ3ElementObject;
  136. typedef TQ3Object                TQ3SharedObject;
  137. typedef TQ3Object                TQ3ViewObject;
  138. typedef TQ3Object                TQ3PickObject;
  139.  
  140. /*
  141.  * There are several types of SharedObjects:
  142.  *    RENDERERs, which paint to a drawContext
  143.  *    DRAWCONTEXTs, which are an interface to a device 
  144.  *    SETs, which maintains "mathematical sets" of ELEMENTs
  145.  *    FILEs, which maintain state information for a metafile
  146.  *    SHAPEs, which affect the state of the View
  147.  *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  148.  *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  149.  *    TRACKERs, which represent a position and orientation in the user interface
  150.  *  STRINGs, which are abstractions of text string data.
  151.  *    STORAGE, which is an abstraction for stream-based data storage (files, memory)
  152.  *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  153.  *    VIEWHINTs, which specifies viewing preferences in FILEs
  154.  */
  155. typedef TQ3SharedObject            TQ3RendererObject;
  156. typedef TQ3SharedObject            TQ3DrawContextObject;
  157. typedef TQ3SharedObject            TQ3SetObject;
  158. typedef TQ3SharedObject            TQ3FileObject;
  159. typedef TQ3SharedObject            TQ3ShapeObject;
  160. typedef TQ3SharedObject            TQ3ShapePartObject;
  161. typedef TQ3SharedObject            TQ3ControllerStateObject;
  162. typedef TQ3SharedObject            TQ3TrackerObject;
  163. typedef TQ3SharedObject            TQ3StringObject;
  164. typedef TQ3SharedObject            TQ3StorageObject;
  165. typedef TQ3SharedObject            TQ3TextureObject;
  166. typedef TQ3SharedObject            TQ3ViewHintsObject;
  167.  
  168. /*
  169.  * There is one types of SET:
  170.  *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  171.  */
  172. typedef TQ3SetObject                TQ3AttributeSet;
  173.  
  174. /*
  175.  * There are many types of SHAPEs:
  176.  *    LIGHTs, which affect how the RENDERER draws 3-D cues
  177.  *    CAMERAs, which affects the location and orientation of the RENDERER in space
  178.  *    GROUPs, which may contain any number of SHARED OBJECTS
  179.  *    GEOMETRYs, which are representations of three-dimensional data
  180.  *    SHADERs, which affect how colors are drawn on a geometry
  181.  *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  182.  *    TRANSFORMs, which affect the coordinate system in the VIEW
  183.  *    REFERENCEs, which are references to objects in FILEs
  184.  *  UNKNOWN, which hold unknown objects read from a metafile.
  185.  */
  186. typedef TQ3ShapeObject            TQ3GroupObject;
  187. typedef TQ3ShapeObject            TQ3GeometryObject;
  188. typedef TQ3ShapeObject            TQ3ShaderObject;
  189. typedef TQ3ShapeObject            TQ3StyleObject;
  190. typedef TQ3ShapeObject            TQ3TransformObject;
  191. typedef TQ3ShapeObject            TQ3LightObject;
  192. typedef TQ3ShapeObject            TQ3CameraObject;
  193. typedef TQ3ShapeObject            TQ3UnknownObject;
  194. typedef TQ3ShapeObject            TQ3ReferenceObject;
  195.  
  196. /*
  197.  * For now, there is only one type of SHAPEPARTs:
  198.  *    MESHPARTs, which describe some part of a mesh
  199.  */
  200. typedef TQ3ShapePartObject        TQ3MeshPartObject;
  201.  
  202. /*
  203.  * There are three types of MESHPARTs:
  204.  *    MESHFACEPARTs, which describe a face of a mesh
  205.  *    MESHEDGEPARTs, which describe a edge of a mesh
  206.  *    MESHVERTEXPARTs, which describe a vertex of a mesh
  207.  */
  208. typedef TQ3MeshPartObject        TQ3MeshFacePartObject;
  209. typedef TQ3MeshPartObject        TQ3MeshEdgePartObject;
  210. typedef TQ3MeshPartObject        TQ3MeshVertexPartObject;
  211.  
  212. /*
  213.  * A DISPLAY Group can be drawn to a view
  214.  */
  215. typedef TQ3GroupObject            TQ3DisplayGroupObject;
  216.  
  217. /*
  218.  * There are many types of SHADERs:
  219.  *    SURFACESHADERs, which affect how the surface of a geometry is painted
  220.  *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  221.  */
  222. typedef TQ3ShaderObject            TQ3SurfaceShaderObject;
  223. typedef TQ3ShaderObject            TQ3IlluminationShaderObject;
  224.  
  225. /*
  226.  * A handle to an object in a group
  227.  */
  228. typedef struct TQ3GroupPositionPrivate    *TQ3GroupPosition;
  229.  
  230.  
  231. /******************************************************************************
  232.  **                                                                             **
  233.  **                            Client/Server Things                             **
  234.  **                                                                             **
  235.  *****************************************************************************/
  236.  
  237. typedef void *TQ3ControllerRef;
  238.  
  239.  
  240. /******************************************************************************
  241.  **                                                                             **
  242.  **                            Flags and Switches                                 **
  243.  **                                                                             **
  244.  *****************************************************************************/
  245.  
  246. typedef enum TQ3Boolean {
  247.     kQ3False,
  248.     kQ3True
  249. } TQ3Boolean;
  250.  
  251. typedef enum TQ3Switch {
  252.     kQ3Off,
  253.     kQ3On
  254. } TQ3Switch;
  255.  
  256. typedef enum TQ3Status {
  257.     kQ3Failure,
  258.     kQ3Success
  259. } TQ3Status;
  260.  
  261. typedef enum TQ3Axis {
  262.     kQ3AxisX,
  263.     kQ3AxisY,
  264.     kQ3AxisZ
  265. } TQ3Axis;
  266.  
  267. typedef enum TQ3PixelType {
  268.     kQ3PixelTypeRGB32,
  269.     kQ3PixelTypeRGB24,
  270.     kQ3PixelTypeRGB16,
  271.     kQ3PixelTypeRGB8
  272. } TQ3PixelType;
  273.  
  274. typedef enum TQ3Endian{
  275.     kQ3EndianBig,
  276.     kQ3EndianLittle
  277. } TQ3Endian;
  278.  
  279. typedef enum TQ3EndCapMasks {
  280.     kQ3EndCapNone            = 0,
  281.     kQ3EndCapMaskTop        = 1 << 0,
  282.     kQ3EndCapMaskBottom        = 1 << 1
  283. } TQ3EndCapMasks;
  284.  
  285. typedef unsigned long TQ3EndCap;
  286.  
  287.  
  288. /******************************************************************************
  289.  **                                                                             **
  290.  **                        Point and Vector Definitions                         **
  291.  **                                                                             **
  292.  *****************************************************************************/
  293.  
  294. typedef struct TQ3Vector2D {
  295.     float        x;
  296.     float        y;
  297. } TQ3Vector2D;
  298.  
  299. typedef struct TQ3Vector3D {
  300.     float         x;
  301.     float        y;
  302.     float        z;
  303. } TQ3Vector3D;
  304.  
  305. typedef struct TQ3Point2D {
  306.     float        x;
  307.     float        y;
  308. } TQ3Point2D;
  309.  
  310. typedef struct TQ3Point3D {
  311.     float         x;
  312.     float        y;
  313.     float        z;
  314. } TQ3Point3D;
  315.  
  316. typedef struct TQ3RationalPoint4D {
  317.     float         x;
  318.     float        y;
  319.     float        z;
  320.     float        w;
  321. } TQ3RationalPoint4D;
  322.  
  323. typedef struct TQ3RationalPoint3D {
  324.     float        x;
  325.     float        y;
  326.     float        w;
  327. } TQ3RationalPoint3D;
  328.  
  329.  
  330. /******************************************************************************
  331.  **                                                                             **
  332.  **                                Quaternion                                     **
  333.  **                                                                             **
  334.  *****************************************************************************/
  335.  
  336. typedef struct TQ3Quaternion {
  337.     float        w;
  338.     float        x;
  339.     float        y;
  340.     float        z;
  341. } TQ3Quaternion;
  342.  
  343.  
  344. /******************************************************************************
  345.  **                                                                             **
  346.  **                                Ray Definition                                 **
  347.  **                                                                             **
  348.  *****************************************************************************/
  349.  
  350. typedef struct TQ3Ray3D {
  351.     TQ3Point3D        origin;
  352.     TQ3Vector3D        direction;
  353. } TQ3Ray3D;
  354.  
  355.  
  356. /******************************************************************************
  357.  **                                                                             **
  358.  **                        Parameterization Data Structures                     **
  359.  **                                                                             **
  360.  *****************************************************************************/
  361.  
  362. typedef struct TQ3Param2D {
  363.     float            u;
  364.     float            v;
  365. } TQ3Param2D;
  366.  
  367. typedef struct TQ3Param3D {
  368.     float            u;
  369.     float            v;
  370.     float            w;
  371. } TQ3Param3D;
  372.  
  373. typedef struct TQ3Tangent2D {
  374.     TQ3Vector3D        uTangent;
  375.     TQ3Vector3D        vTangent;
  376. } TQ3Tangent2D;
  377.  
  378. typedef struct TQ3Tangent3D {
  379.     TQ3Vector3D        uTangent;
  380.     TQ3Vector3D        vTangent;
  381.     TQ3Vector3D        wTangent;
  382. } TQ3Tangent3D;
  383.  
  384.  
  385. /******************************************************************************
  386.  **                                                                             **
  387.  **                        Polar and Spherical Coordinates                         **
  388.  **                                                                             **
  389.  *****************************************************************************/
  390.  
  391.  typedef struct TQ3PolarPoint {
  392.      float        r;
  393.      float        theta;
  394.   } TQ3PolarPoint;
  395.  
  396.  typedef struct TQ3SphericalPoint {
  397.      float        rho;
  398.      float        theta;
  399.      float        phi;
  400.  } TQ3SphericalPoint;
  401.  
  402.  
  403. /******************************************************************************
  404.  **                                                                             **
  405.  **                            Color Definition                                 **
  406.  **                                                                             **
  407.  *****************************************************************************/
  408.  
  409. typedef struct TQ3ColorRGB {
  410.     float             r;
  411.     float            g;
  412.     float            b;
  413. } TQ3ColorRGB;
  414.  
  415.  
  416. typedef struct TQ3ColorARGB {
  417.     float             a;
  418.     float             r;
  419.     float            g;
  420.     float            b;
  421. } TQ3ColorARGB;
  422.  
  423.  
  424. /******************************************************************************
  425.  **                                                                             **
  426.  **                                    Vertices                                 **
  427.  **                                                                             **
  428.  *****************************************************************************/
  429.  
  430. typedef struct TQ3Vertex3D {
  431.     TQ3Point3D            point;
  432.     TQ3AttributeSet        attributeSet;
  433. }  TQ3Vertex3D;
  434.  
  435.  
  436. /******************************************************************************
  437.  **                                                                             **
  438.  **                                    Matrices                                 **
  439.  **                                                                             **
  440.  *****************************************************************************/
  441.  
  442. typedef struct TQ3Matrix3x3 {
  443.     float    value[3][3];
  444. } TQ3Matrix3x3;
  445.  
  446. typedef struct TQ3Matrix4x4 {
  447.     float    value[4][4];
  448. } TQ3Matrix4x4;
  449.  
  450.  
  451. /******************************************************************************
  452.  **                                                                             **
  453.  **                                Bitmap/Pixmap                                 **
  454.  **                                                                             **
  455.  *****************************************************************************/
  456.  
  457. typedef struct TQ3Pixmap {
  458.     void                *image;
  459.     unsigned long        width;
  460.     unsigned long        height;
  461.     unsigned long        rowBytes;
  462.     unsigned long        pixelSize;
  463.     TQ3PixelType        pixelType;
  464.     TQ3Endian            bitOrder;
  465.     TQ3Endian            byteOrder;
  466. } TQ3Pixmap;
  467.  
  468. typedef struct TQ3StoragePixmap {
  469.     TQ3StorageObject    image;
  470.     unsigned long        width;
  471.     unsigned long        height;
  472.     unsigned long        rowBytes;
  473.     unsigned long        pixelSize;
  474.     TQ3PixelType        pixelType;
  475.     TQ3Endian            bitOrder;
  476.     TQ3Endian            byteOrder;
  477. } TQ3StoragePixmap;
  478.  
  479. typedef struct TQ3Bitmap {
  480.     unsigned char        *image;
  481.     unsigned long        width;
  482.     unsigned long        height;
  483.     unsigned long        rowBytes;
  484.     TQ3Endian            bitOrder;
  485. } TQ3Bitmap;
  486.  
  487. #ifdef __cplusplus
  488. extern "C" {
  489. #endif    /* __cplusplus */
  490.  
  491.  
  492. QD3D_EXPORT TQ3Status Q3Bitmap_Empty(
  493.     TQ3Bitmap            *bitmap);
  494.  
  495. QD3D_EXPORT unsigned long Q3Bitmap_GetImageSize(
  496.     unsigned long        width,
  497.     unsigned long        height);
  498.  
  499.  
  500. #ifdef __cplusplus
  501. }
  502. #endif    /* __cplusplus */
  503.  
  504.  
  505. /******************************************************************************
  506.  **                                                                             **
  507.  **                        Higher dimension quantities                             **
  508.  **                                                                             **
  509.  *****************************************************************************/
  510.  
  511. typedef struct TQ3Area {
  512.     TQ3Point2D             min;
  513.     TQ3Point2D             max;
  514. } TQ3Area;
  515.  
  516. typedef struct TQ3PlaneEquation {
  517.     TQ3Vector3D            normal;
  518.     float                constant;
  519. } TQ3PlaneEquation;
  520.  
  521. typedef struct TQ3BoundingBox {
  522.     TQ3Point3D             min;
  523.     TQ3Point3D             max;
  524.     TQ3Boolean            isEmpty;
  525. } TQ3BoundingBox;
  526.  
  527. typedef struct TQ3BoundingSphere {
  528.     TQ3Point3D            origin;
  529.     float                radius;
  530.     TQ3Boolean            isEmpty;
  531. } TQ3BoundingSphere;
  532.  
  533. /*
  534.  *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  535.  *    calls in the View. It's a hint to the system as to how it should 
  536.  *    compute the bbox of a shape:
  537.  *
  538.  *    kQ3ComputeBoundsExact:    
  539.  *        Vertices of shapes are transformed into world space and
  540.  *        the world space bounding box is computed from them.  Slow!
  541.  *    
  542.  *    kQ3ComputeBoundsApproximate: 
  543.  *        A local space bounding box is computed from a shape's
  544.  *        vertices.  This bbox is then transformed into world space,
  545.  *        and its bounding box is taken as the shape's approximate
  546.  *        bbox.  Fast but the bbox is larger than optimal.
  547.  */
  548.  
  549. typedef enum TQ3ComputeBounds {
  550.     kQ3ComputeBoundsExact,
  551.     kQ3ComputeBoundsApproximate
  552. } TQ3ComputeBounds;
  553.  
  554.  
  555. /******************************************************************************
  556.  **                                                                             **
  557.  **                            Object System Types                                 **
  558.  **                                                                             **
  559.  *****************************************************************************/
  560.  
  561. typedef struct TQ3ObjectClassPrivate        *TQ3ObjectClass;
  562.  
  563. typedef unsigned long                         TQ3MethodType;
  564.  
  565. /*
  566.  * Object methods
  567.  */
  568. #define kQ3MethodTypeObjectUnregister        Q3_METHOD_TYPE('u','n','r','g')
  569.  
  570. /*
  571.  * IO Methods
  572.  */
  573. #define kQ3MethodTypeObjectFileVersion        Q3_METHOD_TYPE('v','e','r','s') /* version */
  574. #define kQ3MethodTypeObjectTraverse            Q3_METHOD_TYPE('t','r','v','s') /* byte count */
  575. #define kQ3MethodTypeObjectWrite            Q3_METHOD_TYPE('w','r','i','t') /* Dump info to file */
  576. #define kQ3MethodTypeObjectReadData            Q3_METHOD_TYPE('r','d','d','t') /* Read info from file into buffer or, attach read data to parent */ 
  577.  
  578. typedef void (*TQ3FunctionPointer)(
  579.     void);
  580.  
  581. typedef TQ3FunctionPointer (*TQ3MetaHandler)(
  582.     TQ3MethodType        methodType);
  583.  
  584. /*
  585.  * MetaHandler:
  586.  *        When you give a metahandler to QuickDraw 3D, it is called multiple times to
  587.  *        build method tables, and then is thrown away. You are guaranteed that
  588.  *        your metahandler will never be called again after a call that was passed
  589.  *        a metahandler returns.
  590.  *
  591.  *        Your metahandler should contain a switch on the methodType passed to it
  592.  *        and should return the corresponding method as an TQ3FunctionPointer.
  593.  *
  594.  *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  595.  *        passed a methodType that you do not understand, ALWAYS return NULL.
  596.  *
  597.  *        These types here are prototypes of how your functions should look.
  598.  */
  599.  
  600. typedef TQ3Status (*TQ3ObjectUnregisterMethod)(
  601.     TQ3ObjectClass        objectClass);
  602.     
  603. /*
  604.  * See QD3DIO.h for the IO method types: 
  605.  *        ObjectReadData, ObjectTraverse, ObjectWrite
  606.  */
  607.  
  608. /******************************************************************************
  609.  **                                                                             **
  610.  **                            Object System Macros                             **
  611.  **                                                                             **
  612.  *****************************************************************************/
  613.  
  614. #define Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d)         \
  615.             ((const unsigned long)                     \
  616.             ((const unsigned long) (a) << 24) |     \
  617.             ((const unsigned long) (b) << 16) |        \
  618.             ((const unsigned long) (c) << 8)  |     \
  619.             ((const unsigned long) (d)))
  620.  
  621. #define Q3_OBJECT_TYPE(a,b,c,d) \
  622.     ((TQ3ObjectType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  623.     
  624. #define Q3_METHOD_TYPE(a,b,c,d) \
  625.     ((TQ3MethodType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  626.  
  627.  
  628. /******************************************************************************
  629.  **                                                                             **
  630.  **                                Object Types                                 **
  631.  **                                                                             **
  632.  *****************************************************************************/
  633.  
  634. /*
  635.  * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  636.  *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  637.  */
  638. #define kQ3ObjectTypeInvalid                            0
  639. #define kQ3ObjectTypeView                                Q3_OBJECT_TYPE('v','i','e','w')
  640. #define kQ3ObjectTypeElement                            Q3_OBJECT_TYPE('e','l','m','n')
  641.     #define kQ3ElementTypeAttribute                        Q3_OBJECT_TYPE('e','a','t','t')
  642. #define kQ3ObjectTypePick                                Q3_OBJECT_TYPE('p','i','c','k')
  643.     #define kQ3PickTypeWindowPoint                        Q3_OBJECT_TYPE('p','k','w','p')
  644.     #define kQ3PickTypeWindowRect                        Q3_OBJECT_TYPE('p','k','w','r')
  645. #define kQ3ObjectTypeShared                                Q3_OBJECT_TYPE('s','h','r','d')
  646.     #define kQ3SharedTypeRenderer                        Q3_OBJECT_TYPE('r','d','d','r')
  647.         #define kQ3RendererTypeWireFrame                Q3_OBJECT_TYPE('w','r','f','r')
  648.         #define kQ3RendererTypeGeneric                    Q3_OBJECT_TYPE('g','n','r','r')
  649.         #define kQ3RendererTypeInteractive                Q3_OBJECT_TYPE('c','t','w','n')
  650.     #define kQ3SharedTypeShape                            Q3_OBJECT_TYPE('s','h','a','p')
  651.         #define kQ3ShapeTypeGeometry                    Q3_OBJECT_TYPE('g','m','t','r')
  652.             #define kQ3GeometryTypeBox                    Q3_OBJECT_TYPE('b','o','x',' ')
  653.             #define kQ3GeometryTypeGeneralPolygon        Q3_OBJECT_TYPE('g','p','g','n')
  654.             #define kQ3GeometryTypeLine                    Q3_OBJECT_TYPE('l','i','n','e')
  655.             #define kQ3GeometryTypeMarker                Q3_OBJECT_TYPE('m','r','k','r')
  656.             #define kQ3GeometryTypeMesh                    Q3_OBJECT_TYPE('m','e','s','h')
  657.             #define kQ3GeometryTypeNURBCurve            Q3_OBJECT_TYPE('n','r','b','c')
  658.             #define kQ3GeometryTypeNURBPatch            Q3_OBJECT_TYPE('n','r','b','p')
  659.             #define kQ3GeometryTypePoint                Q3_OBJECT_TYPE('p','n','t',' ')
  660.             #define kQ3GeometryTypePolygon                Q3_OBJECT_TYPE('p','l','y','g')
  661.             #define kQ3GeometryTypePolyLine                Q3_OBJECT_TYPE('p','l','y','l')
  662.             #define kQ3GeometryTypeTriangle                Q3_OBJECT_TYPE('t','r','n','g')
  663.             #define kQ3GeometryTypeTriGrid                Q3_OBJECT_TYPE('t','r','i','g')
  664.         #define kQ3ShapeTypeShader                        Q3_OBJECT_TYPE('s','h','d','r')
  665.             #define kQ3ShaderTypeSurface                Q3_OBJECT_TYPE('s','u','s','h')
  666.                 #define kQ3SurfaceShaderTypeTexture        Q3_OBJECT_TYPE('t','x','s','u')
  667.             #define kQ3ShaderTypeIllumination            Q3_OBJECT_TYPE('i','l','s','h')
  668.                 #define kQ3IlluminationTypePhong        Q3_OBJECT_TYPE('p','h','i','l')
  669.                 #define kQ3IlluminationTypeLambert        Q3_OBJECT_TYPE('l','m','i','l')
  670.                 #define kQ3IlluminationTypeNULL            Q3_OBJECT_TYPE('n','u','i','l')
  671.         #define kQ3ShapeTypeStyle                        Q3_OBJECT_TYPE('s','t','y','l')
  672.             #define kQ3StyleTypeBackfacing                Q3_OBJECT_TYPE('b','c','k','f')
  673.             #define kQ3StyleTypeInterpolation            Q3_OBJECT_TYPE('i','n','t','p')
  674.             #define kQ3StyleTypeFill                    Q3_OBJECT_TYPE('f','i','s','t')
  675.             #define kQ3StyleTypePickID                    Q3_OBJECT_TYPE('p','k','i','d')
  676.             #define kQ3StyleTypeReceiveShadows            Q3_OBJECT_TYPE('r','c','s','h')
  677.             #define kQ3StyleTypeHighlight                Q3_OBJECT_TYPE('h','i','g','h')
  678.             #define kQ3StyleTypeSubdivision                Q3_OBJECT_TYPE('s','b','d','v')
  679.             #define kQ3StyleTypeOrientation                Q3_OBJECT_TYPE('o','f','d','r')
  680.             #define kQ3StyleTypePickParts                Q3_OBJECT_TYPE('p','k','p','t')
  681.         #define kQ3ShapeTypeTransform                    Q3_OBJECT_TYPE('x','f','r','m')
  682.             #define kQ3TransformTypeMatrix                Q3_OBJECT_TYPE('m','t','r','x')
  683.             #define kQ3TransformTypeScale                Q3_OBJECT_TYPE('s','c','a','l')
  684.             #define kQ3TransformTypeTranslate            Q3_OBJECT_TYPE('t','r','n','s')
  685.             #define kQ3TransformTypeRotate                Q3_OBJECT_TYPE('r','o','t','t')
  686.             #define kQ3TransformTypeRotateAboutPoint     Q3_OBJECT_TYPE('r','t','a','p')
  687.             #define kQ3TransformTypeRotateAboutAxis     Q3_OBJECT_TYPE('r','t','a','a')
  688.             #define kQ3TransformTypeQuaternion            Q3_OBJECT_TYPE('q','t','r','n')
  689.         #define kQ3ShapeTypeLight                        Q3_OBJECT_TYPE('l','g','h','t')
  690.             #define kQ3LightTypeAmbient                    Q3_OBJECT_TYPE('a','m','b','n')
  691.             #define kQ3LightTypeDirectional                Q3_OBJECT_TYPE('d','r','c','t')
  692.             #define kQ3LightTypePoint                    Q3_OBJECT_TYPE('p','n','t','l')
  693.             #define kQ3LightTypeSpot                    Q3_OBJECT_TYPE('s','p','o','t')
  694.         #define kQ3ShapeTypeCamera                        Q3_OBJECT_TYPE('c','m','r','a')
  695.             #define kQ3CameraTypeOrthographic            Q3_OBJECT_TYPE('o','r','t','h')
  696.             #define kQ3CameraTypeViewPlane                Q3_OBJECT_TYPE('v','w','p','l')
  697.             #define kQ3CameraTypeViewAngleAspect        Q3_OBJECT_TYPE('v','a','n','a')
  698.         #define kQ3ShapeTypeGroup                        Q3_OBJECT_TYPE('g','r','u','p')
  699.             #define kQ3GroupTypeDisplay                    Q3_OBJECT_TYPE('d','s','p','g')
  700.                 #define kQ3DisplayGroupTypeOrdered        Q3_OBJECT_TYPE('o','r','d','g')
  701.                 #define kQ3DisplayGroupTypeIOProxy        Q3_OBJECT_TYPE('i','o','p','x')
  702.             #define kQ3GroupTypeLight                    Q3_OBJECT_TYPE('l','g','h','g')
  703.             #define kQ3GroupTypeInfo                    Q3_OBJECT_TYPE('i','n','f','o')
  704.             
  705.         #define kQ3ShapeTypeUnknown                        Q3_OBJECT_TYPE('u','n','k','n')
  706.             #define kQ3UnknownTypeText                    Q3_OBJECT_TYPE('u','k','t','x')
  707.             #define kQ3UnknownTypeBinary                Q3_OBJECT_TYPE('u','k','b','n')
  708.         #define kQ3ShapeTypeReference                    Q3_OBJECT_TYPE('r','f','r','n')
  709.     #define kQ3SharedTypeSet                            Q3_OBJECT_TYPE('s','e','t',' ')
  710.         #define kQ3SetTypeAttribute                        Q3_OBJECT_TYPE('a','t','t','r')
  711.     #define kQ3SharedTypeDrawContext                    Q3_OBJECT_TYPE('d','c','t','x')
  712.         #define kQ3DrawContextTypePixmap                Q3_OBJECT_TYPE('d','p','x','p')
  713.         #define kQ3DrawContextTypeMacintosh                Q3_OBJECT_TYPE('d','m','a','c')
  714.     #define kQ3SharedTypeTexture                        Q3_OBJECT_TYPE('t','x','t','r')
  715.         #define kQ3TextureTypePixmap                    Q3_OBJECT_TYPE('t','x','p','m')
  716.     
  717.     #define kQ3SharedTypeFile                            Q3_OBJECT_TYPE('f','i','l','e')
  718.     #define kQ3SharedTypeStorage                        Q3_OBJECT_TYPE('s','t','r','g')
  719.         #define kQ3StorageTypeMemory                    Q3_OBJECT_TYPE('m','e','m','s')
  720.             #define kQ3MemoryStorageTypeHandle            Q3_OBJECT_TYPE('h','n','d','l')
  721.         #define kQ3StorageTypeUnix                        Q3_OBJECT_TYPE('u','x','s','t')
  722.             #define kQ3UnixStorageTypePath                Q3_OBJECT_TYPE('u','n','i','x')
  723.         #define kQ3StorageTypeMacintosh                    Q3_OBJECT_TYPE('m','a','c','n')
  724.             #define kQ3MacintoshStorageTypeFSSpec        Q3_OBJECT_TYPE('m','a','c','p')                    
  725.     #define kQ3SharedTypeString                            Q3_OBJECT_TYPE('s','t','r','n')
  726.         #define kQ3StringTypeCString                    Q3_OBJECT_TYPE('s','t','r','c')
  727.     #define kQ3SharedTypeShapePart                        Q3_OBJECT_TYPE('s','p','r','t')
  728.         #define kQ3ShapePartTypeMeshPart                Q3_OBJECT_TYPE('s','p','m','h')
  729.             #define kQ3MeshPartTypeMeshFacePart            Q3_OBJECT_TYPE('m','f','a','c')
  730.             #define kQ3MeshPartTypeMeshEdgePart            Q3_OBJECT_TYPE('m','e','d','g')
  731.             #define kQ3MeshPartTypeMeshVertexPart        Q3_OBJECT_TYPE('m','v','t','x')
  732.     #define kQ3SharedTypeControllerState                Q3_OBJECT_TYPE('c','t','s','t')
  733.     #define kQ3SharedTypeTracker                        Q3_OBJECT_TYPE('t','r','k','r')
  734.     #define kQ3SharedTypeViewHints                        Q3_OBJECT_TYPE('v','w','h','n')
  735. #define kQ3ObjectTypeEndGroup                            Q3_OBJECT_TYPE('e','n','d','g')
  736.  
  737. #ifdef __cplusplus
  738. extern "C" {
  739. #endif    /* __cplusplus */
  740.  
  741. /******************************************************************************
  742.  **                                                                             **
  743.  **                            QuickDraw 3D System Routines                     **
  744.  **                                                                             **
  745.  *****************************************************************************/
  746.  
  747. QD3D_EXPORT TQ3Status Q3Initialize(
  748.     void);
  749.  
  750. QD3D_EXPORT TQ3Status Q3Exit(
  751.     void);
  752.  
  753. QD3D_EXPORT TQ3Boolean Q3IsInitialized(
  754.     void);
  755.  
  756. QD3D_EXPORT TQ3Status Q3GetVersion(
  757.     unsigned long        *majorRevision,
  758.     unsigned long        *minorRevision);
  759.  
  760.  
  761. /******************************************************************************
  762.  **                                                                             **
  763.  **                            ObjectClass Routines                             **
  764.  **                                                                             **
  765.  *****************************************************************************/
  766.  
  767. QD3D_EXPORT TQ3Status Q3ObjectClass_Unregister(
  768.     TQ3ObjectClass        objectClass);
  769.  
  770.  
  771. /******************************************************************************
  772.  **                                                                             **
  773.  **                                Object Routines                                 **
  774.  **                                                                             **
  775.  *****************************************************************************/
  776.  
  777. QD3D_EXPORT TQ3Status Q3Object_Dispose(
  778.     TQ3Object             object);
  779.     
  780. QD3D_EXPORT TQ3Object Q3Object_Duplicate(
  781.     TQ3Object            object);
  782.     
  783. QD3D_EXPORT TQ3Status Q3Object_Submit(
  784.     TQ3Object            object,
  785.     TQ3ViewObject        view);
  786.     
  787. QD3D_EXPORT TQ3Boolean Q3Object_IsDrawable(
  788.     TQ3Object            object);
  789.  
  790. QD3D_EXPORT TQ3Boolean Q3Object_IsWritable(
  791.     TQ3Object            object,
  792.     TQ3FileObject        file);
  793.  
  794.  
  795. /******************************************************************************
  796.  **                                                                             **
  797.  **                            Object Type Routines                             **
  798.  **                                                                             **
  799.  *****************************************************************************/
  800.  
  801. QD3D_EXPORT TQ3ObjectType Q3Object_GetType(
  802.     TQ3Object            object);
  803.  
  804. QD3D_EXPORT TQ3ObjectType Q3Object_GetLeafType(
  805.     TQ3Object            object);
  806.  
  807. QD3D_EXPORT TQ3Boolean Q3Object_IsType(
  808.     TQ3Object            object,
  809.     TQ3ObjectType        type);
  810.  
  811.  
  812. /******************************************************************************
  813.  **                                                                             **
  814.  **                            Shared Object Routines                             **
  815.  **                                                                             **
  816.  *****************************************************************************/
  817.  
  818. QD3D_EXPORT TQ3ObjectType Q3Shared_GetType(
  819.     TQ3SharedObject     sharedObject);
  820.  
  821. QD3D_EXPORT TQ3SharedObject Q3Shared_GetReference(
  822.     TQ3SharedObject     sharedObject);
  823.  
  824.  
  825. /******************************************************************************
  826.  **                                                                             **
  827.  **                                Shape Routines                                 **
  828.  **                                                                             **
  829.  *****************************************************************************/
  830.  
  831. QD3D_EXPORT TQ3ObjectType Q3Shape_GetType(
  832.     TQ3ShapeObject    shape);
  833.  
  834. QD3D_EXPORT TQ3Status Q3Shape_GetSet(
  835.     TQ3ShapeObject    shape,
  836.     TQ3SetObject    *set);
  837.  
  838. QD3D_EXPORT TQ3Status Q3Shape_SetSet(
  839.     TQ3ShapeObject    shape,
  840.     TQ3SetObject     set);
  841.  
  842.  
  843. #ifdef __cplusplus
  844. }
  845. #endif  /*  __cplusplus  */
  846.  
  847. #endif /*  QD3D_h  */
  848.